import sqlite3

conn = sqlite3.connect("../Script/douban.db")
print("数据库创建成功")

table_sql = """
    create table douban_movies(
    id INTEGER PRIMARY KEY autoincrement,
    movie_name text,
    scores real,
    discuss text,
    Details text,
    links text)
"""


scores_sql = "select movie_name,scores from douban_movies"

cur = conn.cursor()  # 建立游标对象
# cur.execute(table_sql)  # 创建表
cur.execute(scores_sql) #查询数据
value = cur.fetchall()
# conn.commit()  # 提交
# print("表创建成功")


# print(value)
cur.close()  # 关闭游标对象
conn.close()  # 关闭数据库连接

movie_name = [i[0] for i in value]
print(movie_name)

scores = [i[1] for i in value]
print(list(set(scores)))
